﻿@model IEnumerable<News.CYT369.Com.Domains.Document>
@if (Model != null && Model.Count() > 0)
{
    foreach (var doc in Model)
    {
        var url = Url.Content($"~/Articles/CView/{Base64.ObjectToBase64(new { DocID = doc.Id })}.chtml");
        if (string.IsNullOrEmpty(doc.PreviewImg))
        {
            <li class="article-list-item">
                <div class="doc-info2">
                    <a class="title" href="@url" target="_blank">@doc.Title</a>
                    <div class="author_info">
                        <span>@doc.Author</span>
                        <span>@doc.CreatedTime.ToString("yyyy年M月d日")</span>
                        <span>阅读:@doc.Read</span>
                        <span>赞:@doc.Great</span>
                        <span>收藏：0</span>
                    </div>
                    <div class="summary">@doc.Summary</div>
                </div>
            </li>
        }
        else
        {
            var imgPath = string.Format("{0}/{1}", News.CYT369.Com.Domains.SystemSettingService.Instance.InternalBucket.HttpURL, doc.PreviewImg);
            <li class="article-list-item">
                <a class="title" href="@url" target="_blank">
                    <img class="previe-img" src="@imgPath" />
                </a>
                <div class="doc-info">
                    <a class="title" href="@url" target="_blank">@doc.Title</a>
                    <div class="author_info">
                        @if (doc.TargetURL != null && doc.TargetURL.Length <= 20)
                        {
                            <span>@doc.TargetURL</span>
                        }
                        <span>@doc.Author</span>
                        <span>@doc.CreatedTime.ToString("yyyy年M月d日")</span>
                        <span>阅读:@doc.Read</span>
                        <span>赞:@doc.Great</span>
                        <span>收藏：0</span>
                    </div>
                    <div class="summary">@doc.Summary</div>
                </div>
            </li>
        }
    }
}
